package io;

import java.io.Serializable;
import java.util.Arrays;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/3/8 14:28
 */
public class Student implements Serializable {
    private String name;
    private  int age;
    private String gender;

    /*
        当一个属性被关键字transient修饰后，当这个对象进行序列化时，此属性值会被忽略
        忽略不必要的属性可以达到对象序列化瘦身的目的
        可以减少磁盘开销或提高网络传输
     */
    private transient String[] otherInfo;
    public Student() {
    }


    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }

    public Student(String name, int age, String gender, String[] otherInfo) {

        this.name = name;
        this.age = age;
        this.gender = gender;
        this.otherInfo = otherInfo;
    }
}
